#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
using namespace std;

int main()
{
    long long x;
    cin >> x;
    long long a = sqrt(x);
    long long a1 = a * a, a2 = (a + 1) * (a + 1);
    if (x - a1 > a2 - x) cout << a2;
    else cout << a1;
    return 0;
}